package com.ruoyi.building.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.building.mapper.XgStudentPartyBuildingMapper;
import com.ruoyi.building.domain.XgStudentPartyBuilding;
import com.ruoyi.building.service.IXgStudentPartyBuildingService;

/**
 * 学生党建Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-25
 */
@Service
public class XgStudentPartyBuildingServiceImpl implements IXgStudentPartyBuildingService 
{
    @Autowired
    private XgStudentPartyBuildingMapper xgStudentPartyBuildingMapper;

    /**
     * 查询学生党建
     * 
     * @param stuId 学生党建主键
     * @return 学生党建
     */
    @Override
    public XgStudentPartyBuilding selectXgStudentPartyBuildingByStuId(Long stuId)
    {
        return xgStudentPartyBuildingMapper.selectXgStudentPartyBuildingByStuId(stuId);
    }

    /**
     * 查询学生党建列表
     * 
     * @param xgStudentPartyBuilding 学生党建
     * @return 学生党建
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "d")
    public List<XgStudentPartyBuilding> selectXgStudentPartyBuildingList(XgStudentPartyBuilding xgStudentPartyBuilding)
    {
        return xgStudentPartyBuildingMapper.selectXgStudentPartyBuildingList(xgStudentPartyBuilding);
    }

    /**
     * 新增学生党建
     * 
     * @param xgStudentPartyBuilding 学生党建
     * @return 结果
     */
    @Override
    public int insertXgStudentPartyBuilding(XgStudentPartyBuilding xgStudentPartyBuilding)
    {
        return xgStudentPartyBuildingMapper.insertXgStudentPartyBuilding(xgStudentPartyBuilding);
    }

    /**
     * 修改学生党建
     * 
     * @param xgStudentPartyBuilding 学生党建
     * @return 结果
     */
    @Override
    public int updateXgStudentPartyBuilding(XgStudentPartyBuilding xgStudentPartyBuilding)
    {
        xgStudentPartyBuilding.setUpdateTime(DateUtils.getNowDate());
        return xgStudentPartyBuildingMapper.updateXgStudentPartyBuilding(xgStudentPartyBuilding);
    }

    /**
     * 批量删除学生党建
     * 
     * @param stuIds 需要删除的学生党建主键
     * @return 结果
     */
    @Override
    public int deleteXgStudentPartyBuildingByStuIds(Long[] stuIds)
    {
        return xgStudentPartyBuildingMapper.deleteXgStudentPartyBuildingByStuIds(stuIds);
    }

    /**
     * 删除学生党建信息
     * 
     * @param stuId 学生党建主键
     * @return 结果
     */
    @Override
    public int deleteXgStudentPartyBuildingByStuId(Long stuId)
    {
        return xgStudentPartyBuildingMapper.deleteXgStudentPartyBuildingByStuId(stuId);
    }
}
